Adds an entry using key and value pair into the cache, and returns an existing cache entry with a matching key.
public override AddOrGetExisting<>(
string ,
,
CacheItemPolicy ,
string
)
'Declaration
Public Overloads Overrides Function AddOrGetExisting(Of )( _
ByVal As String, _
ByVal As , _
ByVal As CacheItemPolicy, _
ByVal As String _
) As
'Usage
Dim instance As FileCache
Dim key As String
Dim value As
Dim policy As CacheItemPolicy
Dim regionName As String
Dim value As
value = instance.AddOrGetExisting(Of T)(key, value, policy, regionName)
@Override
public <T> T addOrGetExisting(String key, T value, Class<?> classOfT, CacheItemPolicy policy, String regionName)
public:
AddOrGetExistinggeneric<typename >
(
String^ ,
,
CacheItemPolicy^ ,
String^
) override
Parameters
- key
- Unique identifier of the cache item.
- value
- Data for the cache item.
- policy
- Expiration policy for the item.
- regionName
- Optional name of a region in cache.
Type Parameters
- T
Return Value
The previous cache entry that matches the specified key, if found. If the cache contains an item with the same key, then it will be returned before it is overwritten. Otherwise, null.